// 
// Bachelor of Software Engineering
// Media Design School
// Auckland
// New Zealand
//
// (c) 2005 - 2014 Media Design School
//
// File Name	: TitleScreenView.cpp
// Description	: CTitleScreenView implementation file.
// Author		: Hayden Asplet.
// Mail			: hayden.asplet@mediadesignschool.com
//

// PCH
#include "SpaceInvadersStd.h"

// Library Includes

// This Include
#include "TitleScreenView.h"

// Local Includes
#include "Msvc\resource.h"

CTitleScreenView::CTitleScreenView()
{
	m_background = g_pApp->LoadSprite(IDB_TITLESCREEN);
}

CTitleScreenView::~CTitleScreenView()
{

}

void CTitleScreenView::VUpdate(float _fDeltaTime)
{

}

void CTitleScreenView::VRender(float _fDeltaTime)
{
	g_pApp->RenderSprite(m_background, 0, 0);

	CRenderer* pRenderer = g_pApp->m_pGame->GetRenderer();

	if(pRenderer) {
		pRenderer->RenderGameObjects();
	}
}

bool CTitleScreenView::VMsgProc(const CAppMsg& _krMsg)
{
	switch(_krMsg.m_uMsg) {
		case WM_KEYDOWN: {
			g_pApp->m_pGame->VChangeState(GS_MainMenu);

			break;
		}
		case WM_KEYUP: {
			break;
		}
		case WM_MOUSEMOVE: {

			break;
		}
		case WM_LBUTTONDOWN: {

			break;
		}
		case WM_LBUTTONUP: {

			break;
		}
		case WM_RBUTTONDOWN: {

			break;
		}
		case WM_RBUTTONUP: {

			break;
		}
		default: break;
	}

	return true;
}

void CTitleScreenView::VAttach(TGameObjectId _id)
{
	// Nothing to attach to.
	return;
}
